Bug 164002 - query scripts don't work uninstalled on windows
authorTor Lillqvist <tml@iki.fi>
Tue, 13 Jan 2009 14:04:27 +0000 (14:04 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Tue, 13 Jan 2009 14:04:27 +0000 (14:04 +0000)
2009-01-13  Tor Lillqvist  <tml@iki.fi>

Bug 164002 - query scripts don't work uninstalled on windows

* gtk/gtkmain.c (_gtk_get_libdir): If the gtk DLL is in a ".libs"
folder, assume we are running uninstalled, and use the
configure-time GTK_LIBDIR.

svn path=/trunk/; revision=22110

ChangeLog
gtk/gtkmain.c

index 5b6b00525aa1cf10d45513b04236af29b307c765..4f49b9ddd100c1c94af1d07d21b96a445c4dc9f5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-01-13  Tor Lillqvist  <tml@iki.fi>
+
+       Bug 164002 - query scripts don't work uninstalled on windows
+
+       * gtk/gtkmain.c (_gtk_get_libdir): If the gtk DLL is in a ".libs"
+       folder, assume we are running uninstalled, and use the
+       configure-time GTK_LIBDIR.
+
 2009-01-12  Matthias Clasen  <mclasen@redhat.com>
 
        * NEWS: Refer to tray icon spec, instead of a random email.
index fb5d35af7d1ff82f975e43247fbd911bc1121691..11aee08fbca030f3a7b3c738deedcbfbbc9bb7a1 100644 (file)
@@ -85,9 +85,28 @@ DllMain (HINSTANCE hinstDLL,
   return TRUE;
 }
 
-/* This here before inclusion of gtkprivate.h so that it sees the
- * original GTK_LOCALEDIR definition. Yeah, this is a bit sucky.
+/* These here before inclusion of gtkprivate.h so that the original
+ * GTK_LIBDIR and GTK_LOCALEDIR definitions are seen. Yeah, this is a
+ * bit sucky.
  */
+const gchar *
+_gtk_get_libdir (void)
+{
+  static char *gtk_libdir = NULL;
+  if (gtk_libdir == NULL)
+    {
+      gchar *root = g_win32_get_package_installation_directory_of_module (gtk_dll);
+      gchar *slash = strrchr (root, '\\');
+      if (g_ascii_strcasecmp (slash + 1, ".libs") == 0)
+       gtk_libdir = GTK_LIBDIR;
+      else
+       gtk_libdir = g_build_filename (root, "lib", NULL);
+      g_free (root);
+    }
+
+  return gtk_libdir;
+}
+
 const gchar *
 _gtk_get_localedir (void)
 {
@@ -332,20 +351,6 @@ _gtk_get_datadir (void)
   return gtk_datadir;
 }
 
-const gchar *
-_gtk_get_libdir (void)
-{
-  static char *gtk_libdir = NULL;
-  if (gtk_libdir == NULL)
-    {
-      gchar *root = g_win32_get_package_installation_directory_of_module (gtk_dll);
-      gtk_libdir = g_build_filename (root, "lib", NULL);
-      g_free (root);
-    }
-
-  return gtk_libdir;
-}
-
 const gchar *
 _gtk_get_sysconfdir (void)
 {